package dfbz.demo.homework2;

import java.util.ArrayList;

public class Subject extends Teacher{
    private String subject;
    private ArrayList<Student> list;

    public Subject(String tName, String subject, ArrayList<Student> list) {
        super(tName);
        this.subject = subject;
        this.list = list;
    }

    public Subject() {
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public ArrayList<Student> getList() {
        return list;
    }

    public void setList(ArrayList<Student> list) {
        this.list = list;
    }
    public void show(){
        System.out.println("课程名称："+this.subject);
        System.out.println("授课老师:"+super.gettName());
        for(Student s:list){
            if(s.isChuqin()==true){
                System.out.println("上课："+s.getName());
            }else {
                System.out.println("旷课："+s.getName());
            }

        }
    }
}
